package com.ryan.ohos.extension.widget.expandablelist;


import ohos.agp.components.Component;
import ohos.agp.components.ComponentContainer;

/**
 *
 */
public interface ExpandableItemProvider {

    /**
     * addDataSetObserver
     *
     * @param observer observer
     */
    void addDataSetObserver(DataSetObserver observer);

    /**
     * addDataSetObserver
     *
     * @param observer observer
     */
    void removeDataSetObserver(DataSetObserver observer);

    /**
     * getGroupCount
     *
     * @return int
     */
    int getGroupCount();

    /**
     * getChildrenCount
     *
     * @param groupPosition groupPosition
     * @return int
     */
    int getChildrenCount(int groupPosition);

    /**
     * getGroupItem
     *
     * @param groupPosition groupPosition
     * @return Object
     */
    Object getGroupItem(int groupPosition);

    /**
     * getChildItem
     *
     * @param groupPosition
     * @param childPosition
     * @return Object
     */
    Object getChildItem(int groupPosition, int childPosition);

    /**
     * getGroupId
     *
     * @param groupPosition groupPosition
     * @return long
     */
    long getGroupId(int groupPosition);

    /**
     * getChildId
     *
     * @param groupPosition groupPosition
     * @param childPosition childPosition
     * @return long
     */
    long getChildId(int groupPosition, int childPosition);

    /**
     * hasStableIds
     *
     * @return boolean
     */
    boolean hasStableIds();

    /**
     * getGroupComponent
     *
     * @param groupPosition groupPosition
     * @param isExpanded    isExpanded
     * @param convertView   convertView
     * @param parent        parent
     * @return Component
     */
    Component getGroupComponent(int groupPosition, boolean isExpanded, Component convertView, ComponentContainer parent);

    /**
     * getChildComponent
     *
     * @param groupPosition groupPosition
     * @param childPosition childPosition
     * @param isLastChild   isLastChild
     * @param convertView   convertView
     * @param parent        parent
     * @return Component
     */
    Component getChildComponent(int groupPosition, int childPosition, boolean isLastChild,
                                Component convertView, ComponentContainer parent);

    /**
     * isChildSelectable
     *
     * @param groupPosition groupPosition
     * @param childPosition childPosition
     * @return boolean
     */
    boolean isChildSelectable(int groupPosition, int childPosition);

    /**
     * areAllItemsEnabled
     *
     * @return boolean
     */
    boolean areAllItemsEnabled();

    /**
     * boolean
     *
     * @return isEmpty
     */
    boolean isEmpty();

    /**
     * onGroupExpanded
     *
     * @param groupPosition groupPosition
     */
    void onGroupExpanded(int groupPosition);

    /**
     * onGroupCollapsed
     *
     * @param groupPosition groupPosition
     */
    void onGroupCollapsed(int groupPosition);

    /**
     * getCombinedChildId
     *
     * @param groupId groupId
     * @param childId childId
     * @return long
     */
    long getCombinedChildId(long groupId, long childId);

    /**
     * getCombinedGroupId
     *
     * @param groupId groupId
     * @return long
     */
    long getCombinedGroupId(long groupId);
}
